[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
VS_OpenDbf()         Opens a DBF file and all its NTX files

Description:

  VS_OpenDbf() uses a database dictionary to open a specified database
  and all its associated index files.

Syntax:     

  l_Success = VS_OpenDbf( c_DbfName, [l_Exclusive], [c_Alias],
  [c_Suffix] )

Pass:       

  c_DbfName is a character expression that contains the name of the
  DBF file to open.  No path or extension should be included. i.e.
  "MYFILE" not "C:\DATA\MYFILE.DBF".

  l_Exclusive is an optional logical expression which should be set
  to .T. if c_DbfName is to be opened in exclusive mode, otherwise
  it should be set to .F.  If omitted, l_Exclusive defaults to .F.

  c_Alias is an optional character expression that contains the
  alias name for c_DbfName.  If omitted, c_Alias defaults to the
  same value as c_DbfName.

  c_Suffix is an optional character expression that contains a
  suffix that will be added to the end of c_DbfName.  i.e. if
  c_Suffix is "02" and c_DbfName was "CUST" then VS_OpenDbf()
  would open the file called "CUST02".

Return:     

  l_Success is a logical expression that will be set to .T. if
  VS_OpenDbf() was successful in opening the requested file, otherwise
  it will be set to .F.

Notes:      

  You must have properly setup the database and index dictionaries.
  Sample database and index dictionaries have been provided with this
  library (_DICTFLD.DBF, _DICTHDR.DBF, and _DICTNTX.DBF).  Please study
  these examples to see how to properly setup a database/index
  dictionary.

  If the database file you requested does not exist, it will be created
  (unless the the field called CREATE in _DICTHDR.DBF is set to .F.).


          **************************************
          *** WARNING!!  EXTREMELY IMPORTANT ***
          **************************************

  Clipper v5.0x:

  VS_OPENDBF() requires that you do not open any database file in
  workarea 250. If you do, you will experience unpredictable results!

Example:    

  VS_OpenDbf( "CLIENTS" )

Usage:      

  VS_OpenDbf() is primarily used to allow several different database
  applications to access common databases and maintain common index
  files without having to re-compile and link each application.

  In other words, the database structures and index keys are maintained
  outside of **ALL** applications and thus can be used by all
  applications.

  Example: Let's assume that you are writing a program that maintains an
  inventory database and your main file is called INVENT.DBF.  You have
  an index called INV_NMBR.NTX with a key of "PROD_CODE+WHSE".

  Let's further assume that a co-worker of yours is writing a program
  that produces a listing of inventory based on its sales volume.
  He/She needs an index file called INV_VOL.NTX with a key of
  "TOT_SALES+PROD_CODE".

  All that needs to take place so that both index files are maintained
  is that the index file and its key are added to the index dictionary.
  In this fashion your inventory maintenance program will open and
  maintain the index files needed by your co-worker and vice-versa.

See Also:
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson